package com.ruoyi.buss.report.controller;

import java.util.List;
import java.io.IOException;
import javax.servlet.http.HttpServletResponse;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.PutMapping;
import org.springframework.web.bind.annotation.DeleteMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import com.ruoyi.common.log.annotation.Log;
import com.ruoyi.common.log.enums.BusinessType;
import com.ruoyi.common.security.annotation.PreAuthorize;
import com.ruoyi.common.security.service.TokenService;
import com.ruoyi.system.api.model.LoginUser;
import com.ruoyi.buss.report.domain.QmcyCustJxyxyjb;
import com.ruoyi.buss.report.service.IQmcyCustJxyxyjbService;
import com.ruoyi.common.core.web.controller.BaseController;
import com.ruoyi.common.core.web.domain.AjaxResult;
import com.ruoyi.common.core.utils.poi.ExcelUtil;
import com.ruoyi.common.core.web.page.TableDataInfo;

/**
 * 绩效营销业绩Controller
 * 
 * @author zjh
 * @date 2021-08-03
 */
@RestController
@RequestMapping("/reportLsb")
public class QmcyCustJxyxyjbController extends BaseController
{
    @Autowired
    private IQmcyCustJxyxyjbService qmcyCustJxyxyjbService;

    @Autowired
    private TokenService tokenService;
    
    @PreAuthorize(hasPermi = "buss:reportLsb:getQmcyCustJxyxyjInfo")
    @GetMapping("/getQmcyCustJxyxyjInfo")
    public TableDataInfo list(QmcyCustJxyxyjb qmcyCustJxyxyjb)
    {
    	LoginUser userInfo = tokenService.getLoginUser();
        startPage();
        List<QmcyCustJxyxyjb> list = qmcyCustJxyxyjbService.getQmcyCustJxyxyjInfo(qmcyCustJxyxyjb,userInfo);
        return getDataTable(list);
    }
    
    
//    /**
//     * 查询绩效营销业绩列表
//     */
//    @PreAuthorize(hasPermi = "buss:reportLsb:list")
//    @GetMapping("/list")
//    public TableDataInfo list(QmcyCustJxyxyjb qmcyCustJxyxyjb)
//    {
//        startPage();
//        List<QmcyCustJxyxyjb> list = qmcyCustJxyxyjbService.selectQmcyCustJxyxyjbList(qmcyCustJxyxyjb);
//        return getDataTable(list);
//    }
//
//    /**
//     * 导出绩效营销业绩列表
//     */
//    @PreAuthorize(hasPermi = "buss:reportLsb:export")
//    @Log(title = "绩效营销业绩", businessType = BusinessType.EXPORT)
//    @PostMapping("/export")
//    public void export(HttpServletResponse response, QmcyCustJxyxyjb qmcyCustJxyxyjb) throws IOException
//    {
//        List<QmcyCustJxyxyjb> list = qmcyCustJxyxyjbService.selectQmcyCustJxyxyjbList(qmcyCustJxyxyjb);
//        ExcelUtil<QmcyCustJxyxyjb> util = new ExcelUtil<QmcyCustJxyxyjb>(QmcyCustJxyxyjb.class);
//        util.exportExcel(response, list, "绩效营销业绩数据");
//    }
//
//    /**
//     * 获取绩效营销业绩详细信息
//     */
//    @PreAuthorize(hasPermi = "buss:reportLsb:query")
//    @GetMapping(value = "/{userId}")
//    public AjaxResult getInfo(@PathVariable("userId") String userId)
//    {
//        return AjaxResult.success(qmcyCustJxyxyjbService.selectQmcyCustJxyxyjbById(userId));
//    }
//
//    /**
//     * 新增绩效营销业绩
//     */
//    @PreAuthorize(hasPermi = "buss:reportLsb:add")
//    @Log(title = "绩效营销业绩", businessType = BusinessType.INSERT)
//    @PostMapping
//    public AjaxResult add(@RequestBody QmcyCustJxyxyjb qmcyCustJxyxyjb)
//    {
//        return toAjax(qmcyCustJxyxyjbService.insertQmcyCustJxyxyjb(qmcyCustJxyxyjb));
//    }
//
//    /**
//     * 修改绩效营销业绩
//     */
//    @PreAuthorize(hasPermi = "buss:reportLsb:edit")
//    @Log(title = "绩效营销业绩", businessType = BusinessType.UPDATE)
//    @PutMapping
//    public AjaxResult edit(@RequestBody QmcyCustJxyxyjb qmcyCustJxyxyjb)
//    {
//        return toAjax(qmcyCustJxyxyjbService.updateQmcyCustJxyxyjb(qmcyCustJxyxyjb));
//    }
//
//    /**
//     * 删除绩效营销业绩
//     */
//    @PreAuthorize(hasPermi = "buss:reportLsb:remove")
//    @Log(title = "绩效营销业绩", businessType = BusinessType.DELETE)
//	@DeleteMapping("/{userIds}")
//    public AjaxResult remove(@PathVariable String[] userIds)
//    {
//        return toAjax(qmcyCustJxyxyjbService.deleteQmcyCustJxyxyjbByIds(userIds));
//    }
}
